using Assets.Scripts.GDK;
using SimpleJson;
using System;

namespace Brick
{
	public class ShopPanelModule : gdk_base_Imodule
	{
		private int choicePage;

		public void SetPage(int ipage)
		{
			choicePage = ipage;
		}

		public int GetPage()
		{
			return choicePage;
		}

		public int GetLookAdCount()
		{
			return GameData.dayLookAd;
		}

		public bool GetBuyNewerGift()
		{
			return GameData.buyNewerGift;
		}

		public bool GetBuyWeekerGift()
		{
			return GameData.buyWeekGift;
		}

		public bool GetBuyNoAd()
		{
			return GameData.closeAD;
		}

		public TimeSpan GetNewerTime()
		{
			DateTime dateTime = DateTime.Now;
			if (GameData.newerEnter == string.Empty)
			{
				GameData.newerEnter = SimpleJson.SimpleJson.SerializeObject(dateTime);
			}
			else
			{
				dateTime = SimpleJson.SimpleJson.DeserializeObject<DateTime>(GameData.newerEnter);
			}
			return DateTime.Now - dateTime;
		}
	}
}

